﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Configuration;
using Oracle.DataAccess.Client;
using Wicresoft.UnifyShow2.Portal.Models;
using Wicresoft.UnifyShow.Business;
using Microsoft.Practices.Unity;
using Wicresoft.UnifyShow.BusinessImpl;
using System.Text;
using System.Linq.Expressions;
using System.Web.Security;

namespace Wicresoft.UnifyShow2.Portal.Controllers
{
    public class ITSMDoController : BaseController
    {
        private IUser_X user_x;

        protected override void Dispose(bool disposing)
        {
            ((IDisposable)user_x).Dispose();
        }

        [InjectionConstructor]
        public ITSMDoController(IUser_X _user_x)
        {
            user_x = _user_x;
        }
        //

        public ActionResult Do(string types, string operation, string requstID)
        {

            if (User == null || !User.Identity.IsAuthenticated)
            {
                User_XModel user = AccountController.AuthenticationSSOCookie(user_x, Request);
                {
                    if (user != null)
                    {
                        FormsAuthentication.SetAuthCookie(user.Name, false);
                    }
                    else
                    {
                        return Redirect("/Error/PermissionError.html");
                    }
                }
            }

            ViewData["TypeS"] = types;
            ViewData["Operation"] = operation;
            ViewData["RequestID"] = requstID;

            return View();

        }
    }
}
